/**  

* @Title: AdministratorDaoHibernate.java 

* @Package com.gxbadge.dao.impl 

* @Description: TODO(用一句话描述该文件做什么) 

* @author CST

* @version V1.0  

*/ 

package com.gxbadge.dao.impl;

import java.util.List;

import com.gxbadge.dao.OperatorDao;
import com.gxbadge.dao.base.BaseHibernateDaoSupport;
import com.gxbadge.model.Navigation;
import com.gxbadge.model.Operator;

public class OperatorDaoHibernate extends BaseHibernateDaoSupport implements OperatorDao {

	/* 
	 * {见接口方法说明}
	 */
	public void delete(Operator oper) {
		
		this.getHibernateTemplate().delete(oper);
		
	}

	public List<Operator> findOperListByNav(Navigation nav){
		
		List<Operator> operList = this.getHibernateTemplate().find("from Operator as o where o.nav=?", nav);
		if(operList!=null&&operList.size()>=1){
			return operList;
		}
		return null;
		
	}
	/* 
	 * {见接口方法说明}
	 */
	public List<Operator> findOperAll() {
		
		return null;
	}

	/* 
	 * {见接口方法说明}
	 */
	public Operator findOperByOperId(Integer operId) {
		
		Operator oper = this.getHibernateTemplate().get(Operator.class, operId);
		if(oper!=null){
			return oper;
		}
		return null;
	}

	/* 
	 * {见接口方法说明}
	 */
	public void save(Operator oper) {
		
		this.getHibernateTemplate().save(oper);
		
	}

	/* 
	 * {见接口方法说明}
	 */
	public void update(Operator oper) {
		
		this.getHibernateTemplate().update(oper);
		
	}

	
	
}
